import Vue from 'vue'
import VueRouter from 'vue-router'
import LoginView from '../views/LoginView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: LoginView
  },
  {
    path: '/about',
    component: () => import('../views/AboutView.vue')
  },
  {
    path: '/admin',
    component: () => import('../views/HomeView.vue'),
    children:[
      {
        path: '/parking/psAddNew',
        component: () => import('../views/carView/PmAddNewView')
      },
      {
        path: '/parking/PmList',
        component: () => import('../views/carView/PmListView')
      },
      {
        path: '/parking/psmAddNew',
        component: () => import('../views/carView/PsmAddNewView')
      },
      {
        path: '/parking/psmList',
        component: () => import('../views/carView/PsmListView')
      },
      {
        path: '/person/center',
        component: () => import('../views/personView/PersonalAddNew')
      },
      {
        path: '/person/list',
        component: () => import('../views/personView/PersonalList')
      },
      {
        path: '/announcements/AnnouncementList',
        component: () => import('../views/announcementsView/AnnouncementsList')
      },
      {
        path: '/announcements/Announcements-add-new',
        component: () => import('../views/announcementsView/AnnouncementsAddNew')
      },
    ]

  },
  {
    path: '/reg',
    component: () => import('../views/regView.vue')
  },



]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
